package com.jymj.entity.zjd;

import com.jymj.enumEntity.zjd.ApplyFileEnum;
import com.jymj.utils.FileUtile.FileUtile;
import com.jymj.utils.FileUtile.PathUtiles;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by ljj on 2018/8/30.
 */
@Data
@Accessors(chain = true)
public class ApplyFileEntity implements Serializable {
    private final String APPLE_SAVE = "ApplyFile.dirPath";

    private Integer id;
    //'申请id 无用
    private Integer appId;
    private Integer ylId;
    //'资料名称'
    private String fileName;
    //'文件地址'
    private String  url;
    //'上传时间
    private Date update;
    //材料类型  1翻建承诺书 2申请表 3身份证 4户口本 5房屋照片 6现场公示 7签字意见表 8通过申请表 9驳回申请表 10验收现场照片 11验收资料 12确权登记
    private Integer cltype;
    private String cltypeText;
    //备注
    private String remark;

    //申请
    private ApplyEntity applyEntity;

    private String path;

    public String getPath() {
        return new FileUtile().initFileUtile(APPLE_SAVE).getUrlHead()+getUrl();
    }

    public String getCltypeText() {
        if(getCltype()!=null){
            return ApplyFileEnum.getName(getCltype());
        }
        return null;
    }
}
